<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            border: 15px solid red;
            padding: 10px;
            background-color: #ff6700;
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <div>123</div>
    <script>
        var div = document.querySelector('div');
        //1.client宽高 与 offset宽高 最大的区别是: client不包含边框，但是都包含了内边距
        console.log(div.offsetHeight);
        console.log(div.offsetWidth);
        console.log(div.clientHeight);
        console.log(div.clientWidth);

        //2.client获取上边框和左边框方法,且只有这两个
        console.log(div.clientTop);
        console.log(div.clientLeft);

    </script>
</body>
</html>